Add optional DNS validation to filter out fake SNI targets#43
Open
noleston wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add optional DNS validation to filter out fake SNI targets
Note
Problem & Background
RealiTLScanneris used to find suitable destination (dest) and SNI (serverNames) pairs for VLESS Reality. The goal is to find legitimate websites hosted on the same hosting provider/subnet as the user's VPS to masquerade under them.Why this feature is needed now:
google.com,apple.com,yahoo.com,vk.com).RealiTLScannerhandshakes with them, it receives a forwarded handshake, tricking the scanner into returning them as valid destinations. (This behavior and the need to filter them has been highlighted by users in Add options to resolve IP-addresses of cert-domains and filter by their IP-subnet #21 and Please add DNS probing for skip other reality servers #34).Addressing the doubts in #27
In #27, the question was raised:
While connecting to such a target technically "works" (the handshake succeeds), using them as a Reality destination is highly counterproductive and currently dangerous for the entire hoster, for the following reasons:
google.com,icloud.com, etc.) on a cheap VPS IP is no longer just an "anomaly" — it is a known circumvention marker for DPI systems (like TSPU). Censors now actively identify VLESS+Reality specifically by checking these "exposed" popular SNIs mismatching their ASNs.Filtering out these fake targets is now a necessity for stealth and server survival.
The Solution
This PR adds a
-resolve-domainsflag (disabled by default).When enabled, the scanner:
DNSNames[0], falling back toSubject.CommonName).A/AAAArecords.Implementation Details
sync.RWMutex. Only successful resolutions are stored to prevent permanent domain filtering caused by temporary network timeouts.golang.org/x/sync/singleflightto prevent duplicate concurrent DNS requests for the same domain, protecting the local resolver from overload during high-thread scans.